//
//  SRSettingWeightView.m
//  SportRing
//
//  Created by Apple on 14/10/24.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSettingWeightView.h"

@interface SRSettingWeightView ()


@property (nonatomic, weak) IBOutlet UILabel *weightLabel;


@end

@implementation SRSettingWeightView

- (void)awakeFromNib{
    
    [super awakeFromNib];
    
  
    
    NSInteger defaultValue = 60;
    
  
    
    [self.weightLabel setTextColor:[[UIColor alloc] initWithRed:128/255.0 green:204/255.0 blue:21/255.0 alpha:1]];
    
    [self.srDelegate defaultValue:defaultValue];
}

#pragma mark - ELRulerScrollViewDelegate

-(void)currentValue:(NSInteger)value
{
    [self.weightLabel setText:[NSString stringWithFormat:@"%ld kg",(long)value]];
    
    if (_srDelegate && [_srDelegate respondsToSelector:@selector(currentWeight:)]) {
        
        [_srDelegate currentWeight:value];
    }
}

- (void)didSelectValue:(NSInteger)value
{
    [self.weightLabel setText:[NSString stringWithFormat:@"%ld kg",(long)value]];
    
    if (_srDelegate && [_srDelegate respondsToSelector:@selector(didSelectWeight:)]) {
        
        [_srDelegate didSelectWeight:value];
    }
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
